
//
//  DengLuViewController.m
//  網易
//
//  Created by 赵天宇 on 16/9/16.
//  Copyright © 2016年 赵天宇. All rights reserved.
//

#import "DengLuViewController.h"
#import <ShareSDK/ShareSDK.h>
#import <ShareSDKUI/ShareSDK+SSUI.h>
@interface DengLuViewController (){
    UITextField *zh;
    UITextField *mima;
    UIButton *denglu;
    UILabel *lable;
    UILabel *line;
    UIButton *QQ;
    UIButton *XL;
    UIButton *WX;
    UILabel *qqDown;
    UILabel *xlDown;
    UILabel *wxDown;
    UILabel *labDown;
    UIButton *buttonDown;
}

@end

@implementation DengLuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title=@"登陆网易新闻";
    self.navigationController.navigationBar.barTintColor=[UIColor redColor];
    self.navigationController.navigationBar.barStyle=UIBarStyleBlack;
    self.navigationItem.backBarButtonItem.tintColor=[UIColor whiteColor];
//    初始化zh
    zh= [[UITextField alloc]initWithFrame:CGRectMake(40, 80, 300, 50)];
    zh.placeholder=@"邮箱账号或手机号";
    UIImageView *imageV = [[UIImageView alloc]initWithFrame:CGRectMake(20, 0, 20, 20)];
    imageV.image = [UIImage imageNamed:@"night_qa_login_normal@2x.png"];
    zh.leftViewMode=UITextFieldViewModeAlways;//UITextField 的左边view 出现模式
    zh.leftView=imageV;
//    zh.layer.borderWidth=1;
//    zh.layer.borderColor = [[UIColor grayColor] CGColor];
    [self.view addSubview:zh];
//    初始化mima
    mima=[[UITextField alloc]initWithFrame:CGRectMake(40, 133, 300, 50)];
    mima.placeholder=@"密码";
//    mima.layer.borderWidth=1;
//    mima.layer.borderColor=[[UIColor grayColor]CGColor];
    mima.leftViewMode=UITextFieldViewModeAlways;
    UIImageView *image_2 = [[UIImageView alloc]initWithFrame:CGRectMake(20, 0, 20,20)];
    image_2.image = [UIImage imageNamed:@"plugin_icon_app@2x.png"];
    mima.leftView = image_2;
    [self.view addSubview:mima];
//初始化denglu
    denglu = [UIButton buttonWithType:0];
    denglu.frame= CGRectMake(40, 220, 350, 40);
    denglu.backgroundColor = [UIColor grayColor];
    [denglu setTitleColor:[UIColor blackColor] forState:0];
    [denglu setTitle:@"登陆" forState:0];
    denglu.layer.masksToBounds=YES;
    denglu.layer.cornerRadius=10;
    [self.view addSubview:denglu];
//     初始化lable
    lable = [[UILabel alloc]initWithFrame:CGRectMake(40, 300, 200, 30)];
    lable.text=@"还可以选择一下方式登录";
    lable.textColor=[UIColor grayColor];
    [self.view addSubview:lable];
//    初始化line
    line   = [[UILabel alloc]initWithFrame:CGRectMake(0, 331, self.view.frame.size.width, 1)];
    line.backgroundColor = [UIColor grayColor];
    [self.view addSubview:line];
//    初始化qq
    QQ = [UIButton buttonWithType:0];
    QQ.frame = CGRectMake(30, 360, 80, 60);
    [QQ setBackgroundImage:[UIImage imageNamed:@"share_platform_qqfriends@2x.png"] forState:0];
    [self.view addSubview:QQ];
    //    初始化wx

    WX = [UIButton buttonWithType:0];
    WX.frame=CGRectMake(160, 360, 80, 60);
    [WX setBackgroundImage:[UIImage imageNamed:@"share_platform_wechat@2x.png"] forState:0];
    [WX addTarget:self action:@selector(denglu) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:WX];
    //    初始化xl

    XL = [UIButton buttonWithType:0];
    XL.frame = CGRectMake(290, 360, 80, 60);
    [XL setBackgroundImage:[UIImage imageNamed:@"share_platform_sina@2x.png"] forState:0];
    [self.view addSubview:XL];
    //    初始化qqDown
    qqDown = [[UILabel alloc]initWithFrame:CGRectMake(30, 430, 80, 20)];
    qqDown.text=@"QQ账号登陆";
    qqDown.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:qqDown];
    //    初始化wxDown
    wxDown = [[UILabel alloc]initWithFrame:CGRectMake(160, 430, 100, 20)];
    wxDown.text=@"微信账号登陆";
    wxDown.font=[UIFont systemFontOfSize:14];
    [self.view addSubview:wxDown];
    //    初始化xlDown
    xlDown = [[UILabel alloc]initWithFrame:CGRectMake(290, 430, 100, 20)];
    xlDown.text=@"新浪微博登陆";
    xlDown.font=[UIFont systemFontOfSize:14];
    [self.view addSubview:xlDown];
//   初始化lableDown
    labDown = [[UILabel alloc]initWithFrame:CGRectMake(160, 630, 80, 20)];
    labDown.text=@"没有账号?";
    labDown.textColor=[UIColor grayColor];
    labDown.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:labDown];
//    初始化buttonDown
    buttonDown = [UIButton buttonWithType:0];
    [buttonDown setTitle:@"手机号快速注册" forState:0];
    buttonDown.frame=CGRectMake(220, 630, 200, 20);
    buttonDown.titleLabel.font = [UIFont systemFontOfSize:14];
    [buttonDown setTitleColor:[UIColor grayColor] forState:0];
    [self.view addSubview:buttonDown];

    // Do any additional setup after loading the view.
}
-(void)denglu{
    [ShareSDK authorize:SSDKPlatformTypeSinaWeibo settings:nil onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error) {
        
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
